﻿(function () {
    var submitPet = function(){
        var petNameInput = document.getElementById("petname");
        var petName = petNameInput.value;

        var petBirthdateInput = document.getElementById("birthdate").winControl;
        var petBirthdate = petBirthdateInput.current.toDateString();

        var petBreedInput = document.getElementById("breed");
        var petBreed = petBreedInput.options[petBreedInput.selectedIndex].value;

        var petGendegInput = document.getElementById("gender");
        var petGender = petGendegInput.options[petGendegInput.selectedIndex].value;

        var petBarcodeInput = document.getElementById("barcode");
        var petBarcode = petBarcodeInput.value;

        var petColorInput = document.getElementById("color");
        var petColor = petColorInput.value;

        ViewModels.addPet(petName, petBirthdate, petBreed, petGender, petBarcode, petColor);
    }

    

    WinJS.Utilities.markSupportedForProcessing(submitPet);
    

    WinJS.Namespace.define("AddPetCodeBehind", {
        submitPet: submitPet,
        
    });
})()